package com.evil.application.api;

import com.evil.application.config.FeignErrorDecoder;
import com.evil.application.pojo.dto.form.ApplicationFormControlRespDTO;
import com.evil.application.pojo.dto.form.FormControlListReqDTO;
import com.evil.application.pojo.dto.form.FormControlTreeRespDTO;
import com.evil.application.pojo.dto.form.ModifyApplicationFormControlReqDTO;
import com.evil.application.pojo.dto.form.control.*;
import com.evil.application.pojo.dto.template.print.QueryPrintTemplateConfigReqDTO;
import com.evil.application.pojo.dto.template.print.PrintTemplateConfigRespDTO;
import com.evil.common.account.dto.department.DepartmentBaseRespDTO;
import com.evil.common.account.dto.department.DepartmentBaseTreeRespDTO;
import com.evil.common.account.dto.user.UserBaseRespDTO;
import com.evil.common.application.dto.ApplicationKeyVersionReqDTO;
import com.evil.common.core.constant.ServiceNameConstant;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 应用表单控件接口
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@FeignClient(name = ServiceNameConstant.APPLICATION_SERVICE, configuration = {FeignErrorDecoder.class})
public interface RemoteApplicationFormControlService {

    /**
     * 应用表单控件信息
     *
     * @param applicationFormControlInfoReqTO applicationFormControlInfoReqTO
     */
    @PostMapping("/remote/application/form/control/info")
    ApplicationFormControlRespDTO applicationFormControlInfo(@Validated @RequestBody ApplicationFormControlInfoReqTO applicationFormControlInfoReqTO);

    /**
     * 应用表单控件基础信息列表
     *
     * @param applicationKeyVersionReqDTO applicationKeyVersionReqDTO
     */
    @PostMapping("/remote/application/form/control/bases")
    List<ControlBaseInfoDTO> applicationFormControlBaseInfo(@Validated @RequestBody ApplicationKeyVersionReqDTO applicationKeyVersionReqDTO);

    /**
     * 应用表单控件基础信息列表（高级筛选版）
     *
     * @param formControlListReqDTO formControlListReqDTO
     */
    @PostMapping("/remote/application/form/control/bases-similar")
    List<ControlBaseInfoDTO> applicationFormControlList(@Validated @RequestBody FormControlListReqDTO formControlListReqDTO);

    /**
     * 编辑应用表单控件
     *
     * @param modifyApplicationFormControlReqDTO modifyApplicationFormRespDTO
     */
    @PostMapping("/remote/application/form/control/modify")
    void modifyApplicationFormControl(@Validated @RequestBody ModifyApplicationFormControlReqDTO modifyApplicationFormControlReqDTO);

    /**
     * 应用表单控件条件
     *
     * @param formControlListReqDTO formControlListReqDTO
     */
    @PostMapping("/remote/application/form/control/condition")
    List<ControlConditionRespDTO> applicationFormControlCondition(@Validated @RequestBody FormControlListReqDTO formControlListReqDTO);

    /**
     * 应用表单控件树
     *
     * @param controlTreeReqDTO controlTreeReqDTO
     * @return List
     */
    @PostMapping("/remote/application/form/control/tree")
    List<FormControlTreeRespDTO> applicationControlTree(@Validated @RequestBody ControlTreeReqDTO controlTreeReqDTO);

    /**
     * 应用表单控件 可选择部门列表
     *
     * @param memberSelControlReqDTO memSelControlReqDTO
     * @return List
     */
    @PostMapping("/remote/application/form/control/dept-list")
    List<DepartmentBaseRespDTO> getDeptSelectList(@Validated @RequestBody MemberSelControlReqDTO memberSelControlReqDTO);

    /**
     * 应用表单控件 可选择部门列表
     *
     * @param memberSelControlReqDTO memSelControlReqDTO
     * @return List
     */
    @PostMapping("/remote/application/form/control/dept-tree")
    List<DepartmentBaseTreeRespDTO> getDeptSelectTree(@Validated @RequestBody MemberSelControlReqDTO memberSelControlReqDTO);

    /**
     * 应用表单控件 可选择成员列表
     *
     * @param memberSelControlReqDTO memSelControlReqDTO
     * @return List
     */
    @PostMapping("/remote/application/form/control/user-list")
    List<UserBaseRespDTO> getUserSelectList(@Validated @RequestBody MemberSelControlReqDTO memberSelControlReqDTO);

    /**
     * 查看模板配置对照表
     *
     * @param queryPrintTemplateConfigReqDTO queryTemplateConfigReqDTO
     * @return List
     */
    @PostMapping("/remote/application/form/control/template-config")
    List<PrintTemplateConfigRespDTO> queryPrintTemplateConfig(@Validated @RequestBody QueryPrintTemplateConfigReqDTO queryPrintTemplateConfigReqDTO);
}
